/*
 *  WilNoteShape.cpp
 *  Wilson
 *
 *  Created by Sebastian Orfino on 1/23/12.
 *  Copyright 2012 lbs3. All rights reserved.
 *
 */

#include "VCPlugInHeaders.h"

// Interface includes:
#include "IGeometry.h"
#include "IGraphicsPort.h"

// General includes:
#include "CGraphicFrameShape.h"

#include "WilID.h"


/** Esta clase la uso para NO dibujar el marcador cuando se esta imprimiendo o cuando se esta haciendo una previa de impresion */
class WilNoteShape : public CGraphicFrameShape {
	

public:
	
	WilNoteShape(IPMUnknown *);
	virtual ~WilNoteShape();
	
protected:
	
	/**
	 Called by the parent class Draw() method.  Responsible for drawing everything
	 in the bounds of this object.
	 @param	gd The current drawing context.
	 @param	flags The IShape drawing flags for the current drawing context.
	 */
	virtual void DrawShape(GraphicsData* gd, int32 flags);
	
};

CREATE_PMINTERFACE(WilNoteShape, kWilNoteShapeImpl)

/* BscShpShape Constructor
 */
WilNoteShape::WilNoteShape(IPMUnknown* boss)
: CGraphicFrameShape(boss)
{
}


/* BscShpShape Destructor
 */
WilNoteShape::~WilNoteShape()
{
}


void WilNoteShape::DrawShape(GraphicsData* gd, int32 flags)
{
	
	do {
		
		//no dibujamos cuando se imprime IShape::kPreviewMode me dice Nico que es conveniente que se vean. Siempre se pueden coultar desde la paleta.
		BREAK_IF(flags & IShape::kPrinting);
		
		/*if ((flags & IShape::kPrinting))// || (flags & IShape::kPreviewMode))
			break; 
		*/
		
		// Get the graphics port so we can draw to it.  The graphics
		// port is already set (by the parentClass::Draw() method) for
		// drawing in page item inner coordinates.
		if ( gd == nil )
		{
			ASSERT_FAIL("Nil GraphicsData*");
			break;
		}
	/*	IGraphicsPort* gPort = gd->GetGraphicsPort();
		if (gPort == nil)
		{
			ASSERT_FAIL("Nil IGraphicsPort*");
			break;
		}
	
		// Get the geometry for this item in inner coords.
		const PMRect r = fGeometry->GetStrokeBoundingBox();
		
		// Draw a background.
		// Fill the item boundary with gray & draw an 'X' (the diagonals)
		gPort->gsave();
		gPort->rectpath(r);
		gPort->setgray(0.75);
		gPort->fill();
		gPort->moveto(r.Left(), r.Top());
		gPort->lineto(r.Right(), r.Bottom());
		gPort->moveto(r.Right(), r.Top());
		gPort->lineto(r.Left(), r.Bottom());
		gPort->setlinewidth(0);
		gPort->stroke();
		gPort->grestore();*/
		
		// Draw frame and contents.
		CGraphicFrameShape::DrawShape(gd, flags);
		
	} while(false);
	
}


